home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr33 / sw200mar.zip / SW.C < prev    next >
C/C++ Source or Header  |  1993-05-12  |  5KB  |  100 lines

  1. /********************************************************************/
  2. /*                                                                  */
  3. /*      █▀▀▀ ▀▀█▀▀ █▀▀▀█ █▀▀▀█      █   █ █▀▀▀█ ▀▀█▀▀ █▀▀▀ █  █     */
  4. /*      █      █   █   █ █   █      █   █ █   █   █   █    █  █     */
  5. /*      ▀▀▀█   █   █   █ █▀▀▀▀      █   █ █▀▀▀█   █   █    █▀▀█     */
  6. /*         █   █   █   █ █          █ █ █ █   █   █   █    █  █     */
  7. /*      ▀▀▀▀   ▀   ▀▀▀▀▀ ▀          ▀▀▀▀▀ ▀   ▀   ▀   ▀▀▀▀ ▀  ▀     */
  8. /*                      Stop Watch version 2.00                     */
  9. /*                                                                  */
  10. /*                       DISCLAIMER OF WARRANTY                     */
  11. /*              Stop Watch is sold without any expressed            */
  12. /*                 or implied warranties whatsoever.                */
  13. /*                  The user assumes the entire risk                */
  14. /*                         of using this program.                   */
  15. /*             The programmer and any assistants will not           */
  16. /*              be held liable for any damages direct or            */
  17. /*       consequential, caused through the use of this program.     */
  18. /*                                                                  */
  19. /********************************************************************/
  20.  
  21.  
  22.  
  23.  
  24.  
  25. #include <bios.h>   /* Borland Libs */
  26. #include <time.h>   /* Borland Libs */
  27. #include <conio.h>  /* Borland Libs */
  28. #include <stdio.h>  /* Borland Libs */
  29.  
  30. void disp_help(void);
  31.  
  32. void main(int argc,char *argv[]){
  33. long start, end, work=0l;
  34. char cmdln[255];
  35.  
  36. if(argv[1][0]==63||argv[1][0]=='h'||argv[1][0]=='H') disp_help();
  37. else if(argv[1][0]==47&&(argv[1][1]==63||argv[1][1]=='h'||argv[1][1]=='H')) disp_help();
  38.  
  39. else {
  40. /***************************************************************/
  41. /*                     For you code writers !                  */
  42. /*       The next few lines are used to read parameters.       */
  43. /*                                                             */
  44. /* The next 2  FOR  loops read the parameters passed in SW     */
  45. /* one character at a time.                                    */
  46. /* These parameters are converted to a variable string called: */
  47. /*                         cmdln                               */
  48. /***************************************************************/
  49.  
  50. for(end=1;end<argc;end++){
  51. for(start=0;argv[end][start]>0;start++) cmdln[work++]=argv[end][start];
  52. cmdln[work++]=' ';
  53. }
  54. cmdln[work]=0;
  55.  
  56. start = biostime(0,0L); /* store start time in variable start      */
  57. system(cmdln);          /* execute parameters passed in program SW */
  58. end=biostime(0, 0L);    /* store stop time in variable end         */
  59.  
  60. end=end-start;          /* total elapsed time stored in end        */
  61. end=end*1000/182;       /* store second plus centiseconds in end   */
  62. start=end/100;          /* store seconds in variable start         */
  63.  
  64. if(start) end=end-(start*100);
  65. work=end;
  66.  
  67. printf("\nStop Watch     rev. 2.00                                %6ld.%02ld Second(s) or",start,work);
  68. end=start/60; /* store minutes in end */
  69. if (end) start=start-(end*60);
  70. printf("\nMarco Ramos (c) May 1993                %9ld Minute(s) %2ld.%02ld Second(s)"
  71. ,end,start,work);
  72. printf("\n");
  73. }
  74. }
  75.  
  76. void disp_help(void){
  77. clrscr();
  78. printf("           █▀▀▀ ▀▀█▀▀ █▀▀▀█ █▀▀▀█      █   █ █▀▀▀█ ▀▀█▀▀ █▀▀▀ █  █\n");
  79. printf("           █      █   █   █ █   █      █   █ █   █   █   █    █  █\n");
  80. printf("           ▀▀▀█   █   █   █ █▀▀▀▀      █   █ █▀▀▀█   █   █    █▀▀█\n");
  81. printf("              █   █   █   █ █          █ █ █ █   █   █   █    █  █\n");
  82. printf("           ▀▀▀▀   ▀   ▀▀▀▀▀ ▀          ▀▀▀▀▀ ▀   ▀   ▀   ▀▀▀▀ ▀  ▀\n");
  83. printf("                        Stop Watch version 2.00                   \n");
  84. printf("\n");
  85. printf("  SW command [parameters] [switches]\n");
  86. printf("     Examples:    SW VER                SW COPY C:\\TEMP\\*.* D:\\TEMP /V\n");
  87. printf("                  SW DIR                SW XCOPY C:\\TEMP\\*.* D:\\TEMP /S/E/V\n");
  88. printf("                  SW CHKDSK             SW DEL *.BAT\n");
  89. printf("                  SW CHKDSK D:          SW MENU.BAT\n");
  90. printf("                  SW ?                  SW WP.EXE\n");
  91. printf("                  SW <enter>  then type  EXIT <enter>  at DOS prompt.\n");
  92. printf("\n");
  93. printf("                                   ╔═══════════════════════════╗\n");
  94. printf("       Support and encourage       ║ Marco Ramos               ║\n");
  95. printf("       your Shareware programmer   ║ 3073 North Service Road   ║\n");
  96. printf("       by sending  $4.00  to:      ║ Burlington Ontario Canada ║\n");
  97. printf("                                   ║ L7N 3G1                   ║\n");
  98. printf("                                   ╚═══════════════════════════╝\n");
  99. }
  100.